﻿using System.Collections.Generic;
using Shot.Presentation.Foundation;
using Shot.Session;
using Shot.Session.Cookies;

namespace Shot.Presentation
{
    /// <summary>
    /// Implementation of IPresenter. This is a generic Presenter that should ideally be overridden. It does not
    /// actually do any sort of presentation.
    /// </summary>
    public abstract class Presenter : IPresenter
    {
        /// <summary>
        /// Client Instance
        /// </summary>
        public AppInstance Instance { get; set; }

        /// <summary>
        /// Application session manager.
        /// </summary>
        public SessionManager Session
        {
            get
            {
                return Instance.Session;
            }
        }

        /// <summary>
        /// Application cookie manager
        /// </summary>
        public CookieManager Cookie
        {
            get
            {
                return Instance.Cookie;
            }
        }

        /// <summary>
        /// Application instance data.
        /// </summary>
        public Dictionary<string, object> Data
        {
            get
            {
                return Instance.Data;
            }
        }

        /// <summary>
        /// Before presentation
        /// </summary>
        public virtual void Before()
        {
            
        }

        /// <summary>
        /// Present
        /// </summary>
        public virtual void Present()
        {
            
        }

        /// <summary>
        /// After presentation
        /// </summary>
        public virtual void After()
        {
            
        }
    }
}
